package com.adam.framework.jdbc;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class UserHandler implements InvocationHandler {
	private User user = null;

	public UserHandler(User user){
		this.user = user;
	}

	@Override
	public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
		if ("getUserName".equals(method.getName())) {
			return "Proxy " + user.getUserName();
		} else {
			return method.invoke(user, args);
		}
	}

}
